import axios from 'axios';
axios.defaults.withCredentials = true;

export default {
	components: {

	},
	data() {
		return {
			
		}
	},
	created() {},
	watch: {

	},
	computed: {

	},
	mounted() {
		
	},
	methods: {
		getTime(date,obj={}){
			if(date){
				let str = obj.str?obj.str:':'
				let h =  date.getHours() ;
				let min = date.getMinutes();
				let s = date.getSeconds();
				let time = (h>10?h:'0'+h)+ str + (min>10?min:'0'+min) + str + (s>10?s:'0'+s);
				return time
			}
		},
		getDate(date,obj={}){
			if(date){
				let str = obj.str?obj.str:'-'
				let d = date.getDate();
				let year  = date.getFullYear();
				let mon = date.getMonth() + 1
				let dateStr = (year>10?year:'0'+year) + str + (mon>10?mon:'0'+mon) +str+ (d>10?d:'0'+d) ; 
				return dateStr
			}
				
		},
	}
}